package com.tianhui.consignortwofei.mvp.model;

import android.content.Context;

import com.fgs.common.CommonModel;
import com.fgs.common.api.CommonConfig;
import com.fgs.common.progress.ObserverResponseListener;
import com.tianhui.consignortwofei.api.OrderApiService;

import java.util.Map;

import io.reactivex.ObservableTransformer;

/**
 * @author fgs
 * @date 2020/8/31
 * @description
 **/
public class SourcePathModel<T> extends CommonModel {
    /**
     * 路线列表
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void sourcePathListModel(Context context, Map<String, String> map, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(OrderApiService.class).sourcePathList(map), observerListener, transformer, isDialog, true);
    }
    /**
     * 路线保存
     *
     * @param context
     * @param map
     * @param isDialog
     * @param transformer
     * @param observerListener
     */
    public void sourcePathSaveModel(Context context, Map<String, String> map, boolean isDialog,
                                    ObservableTransformer<T, T> transformer, ObserverResponseListener observerListener) {

        subscribe(context, CommonConfig.getInstance().create(OrderApiService.class).sourcePathSave(map), observerListener, transformer, isDialog, true);
    }
}
